<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>具名插槽的基本使用</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
    <div id="app">
       <cpn2><button slot="center">标题</button></cpn2>
    </div>
    
    <template id="cpn2">
        <div>
            <!-- 给slot加上名字 -->
            <slot name="left"><span>左边</span></slot>
            <slot name="center"><span>中间</span></slot>
            <slot name="right"><span>右边</span></slot>
        </div>
    </template>
    <script>
       
        const app = new Vue({
            el: "#app",
            data: {
                
            },
            components:{//局部组件注册语法糖
                cpn2:{
                    template: "#cpn2"
                }
            }
        })
    </script>
</body>
</html>